package models

import (
	"time"

	"gorm.io/gorm"
)

// WebhookNotification webhook通知记录表
type WebhookNotification struct {
	gorm.Model
	NotificationType string    `gorm:"type:varchar(50);not null" json:"notification_type"`
	TransactionID    string    `gorm:"type:varchar(50);index" json:"transaction_id"`
	CardID           string    `gorm:"type:varchar(50);index" json:"card_id"`
	MatrixAccount    string    `gorm:"type:varchar(50);index" json:"matrix_account"`
	Platform         string    `gorm:"type:varchar(20);not null" json:"platform"`
	Category         string    `gorm:"type:varchar(50)" json:"category"`
	RawData          JSONMap   `gorm:"type:json" json:"raw_data"`
	ProcessedAt      time.Time `json:"processed_at"`
	Status           string    `gorm:"type:varchar(20);default:'pending'" json:"status"`
	Error            string    `gorm:"type:text" json:"error"`
	UserCard         UserCard  `gorm:"foreignKey:CardID;references:CardID" json:"user_card"`
}
